﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace ZombieMonkeys.Vibria
{
    public partial class OptionsPage : PhoneApplicationPage
    {
        //reference the app page of the application for access to global variables
        GUI.App app;

        /// <summary>
        /// Constructor for the options page
        /// </summary>
        public OptionsPage()
        {
            InitializeComponent();

            app = (GUI.App)Application.Current;

            if (app.HintMode == true)
            {
                hintCheckBox.IsChecked = true;
            }
            else
            {
                hintCheckBox.IsChecked = false;
            }
            if (app.PenMode == true)
            {
                penModeCheckBox.IsChecked = true;
            }
            else
            {
                penModeCheckBox.IsChecked = false;
            }
        }

        /// <summary>
        /// Method to handle the hint mode check box
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void hintCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            //this is the spot where we turn the hint button on and off
            if (hintCheckBox.IsChecked == true)
            {
                app.HintMode = true;
            }
            if (hintCheckBox.IsChecked == false)
            {
                app.HintMode = false;
            }
        }

        /// <summary>
        /// Method to handle the pen mode check box
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void penModeCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            //this is the spot where we turn pen mode on and off
            if (penModeCheckBox.IsChecked == true)
            {
                app.PenMode = true;
            }
            if (penModeCheckBox.IsChecked == false)
            {
                app.PenMode = false;
            }
        }
    }
}